﻿<%@ Page Title="" Language="C#" MasterPageFile="~/views/customer/customermaster.master" AutoEventWireup="true" CodeFile="sp2.aspx.cs" Inherits="sp2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MyContent" Runat="Server">
    <div class="container-fluid">
       <div class="row">
           <div class="col">
               <h3 class="text-center" style="color: white">商品编辑</h3>
                </div>
            </div>
           </div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" DataSourceID="LinqDataSource1" DataKeyNames="ProductID"
        PageSize="5" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical" OnRowDataBound="GridView1_RowDataBound">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" Text="全选" OnCheckedChanged="CheckBox2_CheckedChanged" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="商品编号" InsertVisible="False" ReadOnly="True" DataField="ProductID" />
            <asp:TemplateField HeaderText="类别编号">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" 
                        AutoPostBack="True" 
                        DataSourceID="LinqDataSource2" 
                        EnableUpdate="true" 
                        DataTextField="Producttypeid" 
                        SelectedValue='<%# Bind("Producttypeid") %>' 
                        DataValueField="Producttypeid">
                    </asp:DropDownList>
                    <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="PJTY.dal.DataClasses1DataContext" EntityTypeName="" TableName="Producttype"></asp:LinqDataSource>
                </EditItemTemplate>

                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Producttypeid") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ProductName" HeaderText="商品名称" />
            <asp:BoundField DataField="ProductPrice" HeaderText="商品价格" />
            <asp:BoundField DataField="ProductDescription" HeaderText="商品描述" />
            <asp:BoundField DataField="ProductStock" HeaderText="库存" />
            <asp:CommandField ShowEditButton="True" HeaderText="编辑" />
            <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" EnableUpdate="true" EnableDelete="true" ContextTypeName="PJTY.dal.DataClasses1DataContext" EntityTypeName="" TableName="Product1">

    </asp:LinqDataSource>
    <asp:Button ID="Button1" runat="server" Text="确定" OnClick="Button1_Click" />
    <asp:Label ID="Label1" runat="server" Text="Label" >

    </asp:Label>

</asp:Content>

